package com.meepo.feed.video.fullscreen

import android.content.Context
import android.os.Bundle
import android.view.View
import com.meepo.basic.components.view.SwipeBackUnSupportActivity
import com.meepo.basic.schema.feed.Item
import com.meepo.feed.R
import com.meepo.sdk.utils.ActivityHelper
import com.xiaojinzi.component.support.ParameterSupport
import kotlinx.android.synthetic.main.video_full_screen_list_activity.*

class FullSnVideoListActivity : SwipeBackUnSupportActivity() {

    companion object {
        /**
         * @param videoList 初始视频列表
         */
        fun launch(context: Context, videoList: ArrayList<Item> = arrayListOf()) {
            ActivityHelper.launch(context, FullSnVideoListActivity::class.java, "videoList", videoList)
        }
    }

    override fun initData() {
    }

    override fun initView(view: View, savedInstanceState: Bundle?) {
        val videoList = ParameterSupport.getSerializable<ArrayList<Item>>(intent, "videoList")

        back_iv.setOnClickListener { finish() }

        val fragment = FullSnVideoFragment.instance(videoList)
        loadRootFragment(R.id.frame_layout, fragment)
    }

    override fun setUpContentLayout(): Int = R.layout.video_full_screen_list_activity
}